//goodsclass.js
//获取应用实例
//获取应用实例
// const app = getApp()
const app = getApp()
var utils = require('../../utils/util.js');
Page({
  data: {
    type: 0,
    goodsType: [{
        id: "1",
        name: "标化鞋垫"
      },
      {
        id: "2",
        name: "定制鞋垫"
      },
    ],

  },
  onLoad: function() {
    var that = this
    wx.showLoading({
      title: '加载中',
    })
    that.setData({
      imgPath: app.d.imgPath
    })
    var sucFunc = function (that, res) {
      that.setData({
        goodsList: res.data,
      })

      wx.hideLoading();
    }
    var data = { openid: app.d.openid }
    utils.wxRequest(that, app.d.path, "Goods/index", data, sucFunc);
  },
  // 点击商品分类
  tapGoods: function(e) {
    var that = this;
    this.setData({
      type: e.currentTarget.dataset.index
    })
    if (e.currentTarget.dataset.index == 1){
      console.log(1)
    }
  }
})